{template 'weheader'}
<style>
body{background-color:#f0f0f0;font-weight:300;}
a{color:#666}
.info{background-color:#fff8e1;font-weight:300;}
.weui_tab a{color:#555}
.weui_navbar{line-height:20px;}
.weui_media_box.weui_media_text .weui_media_info {margin-top: 0px;}
.weui_tabbar{height:50px;}
.weui_tabbar_icon {height: 20px;}
.weui_bar_item_on .weui_tabbar_icon i {color: #09BB07;}
.weui_cell_bd i {color:#666;}

.dayu_cells {overflow: hidden;position: relative;}
.sticky-fixed {width: 100%;position: fixed;bottom: 0;z-index:9998;}
.weui-header-right a{padding-left:10px;}
</style>
{if $operation == 'display'}
	<style>
	.record-start-btn {width:18px;height:18px;margin-right:5px;}
	.weui_cells {margin-top:0px;}
	.weui_cell img, .weui_media_title img{width:25px;height:25px;}
	.bg-gray{background-color:#f0f0f0;}
	.dayu_list{font-size:14px;}
	.weui_cell_primary .middle{margin-right:10px;}
	</style>
	<div class="weui_tab_bd">
	{if $reid}
		<div class="bg-blue weui-header "> 
			<div class="weui-header-left">{$mname}</div>
			<h1 class="weui-header-title"></h1>
			<div class="weui-header-right">
				<a href="{php echo $this->createMobileUrl('dayu_form', array('id' => $reid))}">
					<svg class="icon f-white" aria-hidden="true">
						<use xlink:href="#icon-home"></use>
					</svg>
				</a>
			</div>
		</div>
		{if $activity['isinfo']}
		<div class="weui_panel weui_panel_access" style="margin:0;">
			<div class="weui_panel_hd">联系方式</div>
			<div class="weui_panel_bd">
				<div class="weui_media_box weui_media_text" style="padding:5px 15px;" onclick="location.href='http://api.map.baidu.com/marker?location={$par['lat']},{$par['lng']}&title={php echo urlencode($activity[business]);}&content={php echo urlencode($par[address].' 电话'.$par['tel']);}&output=html'">
					<h4 class="weui_media_title">{$par['business']}</h4>
					<p class="weui_media_desc">电话：{$par['tel']}</p>
				</div>
			</div>
			<div class="weui_panel_ft f12">地址：{$par['address']}</div>
		</div>
		<div class="weui_panel weui_panel_access">
		{else}
		<div class="weui_panel weui_panel_access" style="margin:0;">
		{/if}
	

		{loop $rows $item}
            <div class="weui_panel_bd" onclick="location.href='{php echo $this->createMobileUrl('mydayu_form', array('op' => 'detail', 'rerid' => $item['rerid'], 'id' => $reid))}'">
                <div class="weui_media_box weui_media_text weui_panel_ft">
                    <h4 class="weui_media_title">
						{$item['member']} <small class="">{$item['mobile']}</small>
					</h4>
                    <p class="weui_media_desc">
						{loop $children[$item['rerid']] $d}
							{if strstr($d['data'], 'images') || strstr($d['data'], 'attachment')}
								有图,
							{elseif $d['data']}
								{$d['data']},
							{else}
							{/if}
						{/loop}
					</p>
                </div>
            </div>
			<div class="dayu_cells bg-gray">
			<div class="weui_cell">
				<div class="weui_cell_bd weui_cell_primary">
					<small>{php echo date('Y/m/d H:i', $item['createtime'])}</small>
				</div>
				<div class="weui_cell_ft">
					{if !empty($item['rethumb'])}<div class="left"><i class="record-start-btn iconfont f15 f-white">&#xe61e;</i></div>{/if}
					{if !empty($item['revoice'])}<div class="left"><i class="record-start-btn iconfont f15 f-white">&#xe62a;</i></div>{/if}
					{if $item['status'] == 0}<span class="weui_btn weui_btn_mini weui_btn_default right">{$state1}</span>
					{elseif $item['status'] == 1}<span class="weui_btn weui_btn_mini weui_btn_primary right">{$state2}</span>
					{elseif $item['status'] == 2}<span class="weui_btn weui_btn_mini weui_btn_warn right">{$state4}</span>
					{elseif $item['status'] == 3}<span class="weui_btn weui_btn_mini bg-blue right">{$state3}</span>
					{elseif $item['status'] == -1}<span class="weui_btn weui_btn_mini weui_btn_warn right">{$state5}</span>
					{/if}
				</div>
			</div>
			</div>
		{/loop}
		</div>
		{if $pager}<div class="p bg-gray" style="height:32px;">{$pager}</div>{/if}		
		</div>
	</div>
	<div class="weui_tabbar">
		<a href="{php echo $this->createMobileUrl('Mydayu_form',array('weid' => $weid, 'id' => $reid))}" class="weui_tabbar_item {if $_GPC['status'] == ''}weui_bar_item_on{/if}">
			<div class="weui_tabbar_icon">
				<i class="iconfont f20">&#xe600;</i>
			</div>
			<p class="weui_tabbar_label">全部</p>
		</a>
		<a href="{php echo $this->createMobileUrl('Mydayu_form',array('weid' => $weid, 'id' => $reid, 'status'=>0))}" class="weui_tabbar_item {if $_GPC['status'] == '0'}weui_bar_item_on{/if}">
			<div class="weui_tabbar_icon">
				<i class="iconfont f20">&#xe61f;</i>
			</div>
			<p class="weui_tabbar_label">{$state1}</p>
		</a>
		<a href="{php echo $this->createMobileUrl('Mydayu_form',array('weid' => $weid, 'id' => $reid, 'status'=>1))}" class="weui_tabbar_item {if $_GPC['status'] == '1'}weui_bar_item_on{/if}">
			<div class="weui_tabbar_icon">
				<i class="iconfont f20">&#xe60a;</i>
			</div>
			<p class="weui_tabbar_label">{$state2}</p>
		</a>
		<a href="{php echo $this->createMobileUrl('Mydayu_form',array('weid' => $weid, 'id' => $reid, 'status'=>2))}" class="weui_tabbar_item {if $_GPC['status'] == '2'}weui_bar_item_on{/if}">
			<div class="weui_tabbar_icon">
				<i class="iconfont f20">&#xe614;</i>
			</div>
			<p class="weui_tabbar_label">已取消</p>
		</a>
		<a href="{php echo $this->createMobileUrl('Mydayu_form',array('weid' => $weid, 'id' => $reid, 'status'=>3))}" class="weui_tabbar_item {if $_GPC['status'] == '3'}weui_bar_item_on{/if}">
			<div class="weui_tabbar_icon">
				<i class="iconfont f20">&#xe613;</i>
			</div>
			<p class="weui_tabbar_label">{$state3}</p>
		</a>
	</div>
	{else}
		{if $fids}
		<style>
			.dayu-header {padding: 25px 0;}
			.dayu-title {text-align: center;font-size: 25px;color: #3cc51f;font-weight: 400;margin: 0;}
			.dayu-sub-title {color: #888;padding:0 10px;font-size: 14px;text-indent:2em;}
			.dayu-content-padded {padding: 15px;}
			.dayu-second-title {text-align: center;font-size: 24px;color: #3cc51f;font-weight: 400;margin: 0 15%;}
		</style>
			<header class='dayu-header'>
				<h1 class="dayu-title">选择主题</h1>
			</header>
			<div class="weui_tab" style="margin:0 10%;">
			{loop $list $item}
				<a href="{php echo $this->createMobileUrl('mydayu_form', array('weid' => $item[weid], 'id' => $item[reid]))}" class="weui_btn weui_btn_primary" style="color:#fff;">{$item['title']}</a>
			{/loop}
			</div>
		{else}
			<div class="weui_msg">
				<div class='notice '><p><i class="iconfont f22">&#xe61f;</i> 暂无数据</p></div>
			</div>
		{/if}
	{/if}
{elseif $operation == 'detail'}
<style>
.weui_cell_ft {margin-left:10px;font-size:14px;}
.weui_cell_bd {font-size:16px;}
.weui_cells_title {margin-top: 10px;}
#allmap{width:100%;height:200px;display:block}
#allmap img{height:1rem;}

.weui_media_box{padding:10px 15px 5px;}
.weui_panel_hd{color:#333;}
.weui_media_box .weui_media_title, .weui_media_box .weui_media_desc{color:#666;line-height:22px;padding:0;}
.weui_panel .icon{margin-right:2px;}
label{font-weight:700;}
.content .weui_media_desc:after{border-bottom: 1px solid #D9D9D9;}
</style>
		<div class="weui-header bg-blue" style="background-color:{$setting['orderbg']}"> 
			<div class="weui-header-left">
				<a href="javascript:history.go(-1)">
					<svg class="icon f-white" aria-hidden="true">
						<use xlink:href="#icon-left"></use>
					</svg>
				</a>
			</div>
			<h1 class="weui-header-title f16"></h1>
			<div class="weui-header-right">
				<a href="{php echo $this->createMobileUrl('dayu_form', array('id' => $reid))}">
					<svg class="icon f-white" aria-hidden="true">
						<use xlink:href="#icon-home"></use>
					</svg>
				</a>
				<a class="" href="{php echo $this->createMobileUrl('mydayu_form', array('id' => $reid))}">
					<svg class="icon f-white" aria-hidden="true">
						<use xlink:href="#icon-dd"></use>
					</svg>
				</a>
			</div> 
		</div>
<div class="weui_tab_bd">
	<div class="weui_panel weui_panel_access">
		<div class="weui_media_box weui_media_small_appmsg">
			<div class="weui_cells weui_cells_access">
				<div class="weui_cell" style="line-height:12px;">
					<div class="weui_cell_hd">
						<svg class="icon f20 f-orange" aria-hidden="true">
							<use xlink:href="#icon-jihuajindu"></use>
						</svg>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<label class="f14">表单状态</label>
					</div>
					<div class="right block">
						{if $row['status'] == 0}<span class="weui_btn f12 weui_btn_mini weui_btn_default">{$state1}</span>
						{elseif $row['status'] == 1}<span class="weui_btn f12 weui_btn_mini weui_btn_primary">{$state2}</span>
						{elseif $row['status'] == 2}<span class="weui_btn f12 weui_btn_mini weui_btn_warn">{$state4}</span>
						{elseif $row['status'] == 3}<span class="weui_btn f12 weui_btn_mini bg-blue">{$state3}</span>
						{elseif $row['status'] == -1}<span class="weui_btn f12 weui_btn_mini weui_btn_disabled weui_btn_warn">{$state5}</span>
						{/if}
					</div>
					{if $par['isdel']==1 && $row['status'] != 2}<a href="{php echo $this->createMobileUrl('dayu_formDelete', array('id' => $row['rerid'],'openid' => $openid, 'reid' => $activity['reid']))}" onclick="return confirm('删除本记录，此操作不可恢复，确认删除？');return false;" class="weui_btn weui_btn_mini f12 right weui_btn_warn f-white" style="margin-left:5px;">删除此记录</a>{/if}
				</div>
			</div>
		</div>
            <div class="weui_panel_bd">
                <div class="weui_media_box weui_media_appmsg">
                    <div class="weui_media_bd">
                        <h4 class="weui_media_title">{$row['member']}<small style="margin-left:10px;">{$row['mobile']}</small></h4>
                        <p class="weui_media_desc">提交时间：{$row['createtime']}</p>
                    </div>
                </div>
            </div>
	</div>
	<div class="weui_panel">
        <div class="weui_panel_bd">
            <div class="weui_media_box weui_media_small_appmsg">
                <div class="weui_cells weui_cells_access">
                    <a href="javascript:;" class="weui_cell" style="line-height:12px;" {if $row['status'] != 0}onclick="selectmenu('1');"{/if}>
                        <div class="weui_cell_hd">
							<svg class="icon f20 f-orange" aria-hidden="true">
								<use xlink:href="#icon-xinzeng"></use>
							</svg>
						</div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <label class="f14">受理进度</label>
							<small class="f12">{$row['yuyuetime']}</small>
                        </div>
						{if $row['status'] != 0}
                        <span id="cell_1">
							<svg class="icon f14" aria-hidden="true">
								<use xlink:href="#icon-down"></use>
							</svg>
						</span>
						{/if}
                    </a>
                </div>
            </div>
		</div>
        
		<div style="display:none;" id="menu_1">
			<div class="timeline">
			<ul>
				<li class="timeline-item">
					<div class="timeline-item-head{if !empty($row['kfinfo'])}-first{/if}"><i class="weui_icon timeline-item-checked f-white f12 {if empty($row['kfinfo'])}hide{/if}" style="color:#fff;"></i></div>
					<div class="timeline-item-tail {if empty($row['kfinfo'])}hide{/if}"></div>
					<div class="timeline-item-content">
						{if !empty($row['kfinfo'])}
						<h4 class="f-green">
							{$row['kfinfo']}
							<small class="right">客服留言</small>
						</h4>
						{/if}
						{if $activity['isrethumb'] && !empty($row['rethumb'])}
						<p>图片回复：</p>
						<p><image class="weui_uploader_file weui_uploader_status" id="rethumb" src="{$row['rethumbs']}" height="50"></p>
						<script>
							document.querySelector('#rethumb').onclick = function () {
								wx.previewImage({
									current: '{$row['rethumbs']}',
									urls: [
										'{$row['rethumbs']}'
									]
								});
							};
						</script>
						{/if}
						{if $activity['isvoice'] && !empty($row['revoice'])}
						<p>语音答复：<span class="right" id="voice"><audio preload="auto" controls><source src="{$row['revoices']}" /></audio>	</span></p>
						{/if}
						{if !empty($row['file'])}
						<p>相关文件：</p>
						{loop $row['file'] $f}
							<p><a href="{$f}">点击保存到手机</a></p>
						{/loop}
						{/if}
					</div>
				</li>
			</ul>
			</div>
		</div>
	</div>
	<div class="weui_panel weui_panel_access">
		<div class="weui_media_box weui_media_small_appmsg">
			<div class="weui_cells weui_cells_access">
				<div class="weui_cell" style="line-height:12px;">
					<div class="weui_cell_hd">
						<svg class="icon f20 f-orange" aria-hidden="true">
							<use xlink:href="#icon-wancheng"></use>
						</svg>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<label class="f14">表单内容</label>
					</div>
					<div class="right block">
						{if $row['status'] == 0 && $par['edit'] == 1}<a href="{php echo $this->createMobileUrl('edit', array('reid' => $reid, 'rerid' => $rerid))}" class="weui_btn f12 f-white weui_btn_mini bg-blue">修改内容</a>{/if}
					</div>
				</div>
			</div>
		</div>
		<div class="weui_panel_bd">
		{loop $ds $fid $ftitle}
			<div class="weui_cell">
				<div class="weui_cell_bd weui_cell_primary f14">
                {if $ftitle['type'] == 'image'}
					{if $row['fields'][$fid]}
						<image class="weui_uploader_file weui_uploader_status" id="p{$fid}" src="{php echo tomedia($row['fields'][$fid]);}" height="50">
						<script>
						document.querySelector('#p{$fid}').onclick = function () {
							wx.previewImage({
								current: '{php echo tomedia($row['fields'][$fid]);}',
								urls: [
								'{php echo tomedia($row['fields'][$fid]);}'
								]
							});
						};
						</script>
					{else}
						未上传
					{/if}
				{else}
					{if !empty($row['fields'][$fid])}{$row['fields'][$fid]}{else}未填{/if}
                {/if}
				</div>
				<div class="weui_cell_ft f12">{$ftitle['fid']}</div>
			</div>
		{/loop}
		</div>
	</div>
	{if !empty($row['voice']) || !empty($row['thumb'])}
	<div class="weui_panel weui_panel_access">
		<div class="weui_media_box weui_media_small_appmsg">
			<div class="weui_cells weui_cells_access">
				<div class="weui_cell" style="line-height:12px;">
					<div class="weui_cell_hd">
						<svg class="icon f20 f-orange" aria-hidden="true">
							<use xlink:href="#icon-jihua"></use>
						</svg>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<label class="f14">多媒体内容</label>
					</div>
					<small class="right f-orange">
					</small>
				</div>
			</div>
		</div>

		<div class="weui_panel_bd">
		{if $activity['isvoice']==1 && !empty($row['voice'])}
		<div class="weui_cell">
				<div class="weui_cell_bd weui_cell_primary" id="voice">
					<audio preload="auto" controls><source src="{$row['voices']}" /></audio>					
				</div>
				<div class="weui_cell_ft">{$activity['voice']}</div>
		</div>
		{/if}
		{if !empty($row['thumb'])}
        <div class="weui_cell">
            <div class="weui_cell_bd weui_cell_primary">
                <div class="weui_uploader">
                    <div class="weui_uploader_bd">
                        <div class="weui_uploader_files" id="previewImage">
						    {loop $row['thumb'] $pic}
								<img src="{php echo tomedia($pic)}" class="weui_uploader_file" style="height:80px;width:auto;">
						    {/loop}
                        </div>
                    </div>
                </div>
            </div>
        </div>
		<script>
		$(document).ready(function(){
			$("#previewImage").on("click","img",function(event){
				var imgArray = [];
				var curImageSrc = $(this).attr('src');
				var oParent = $(this).parent();
				if (curImageSrc && !oParent.attr('href')) {
					$('#previewImage img').each(function(index, el) {
						var itemSrc = $(this).attr('src');
						imgArray.push(itemSrc);
					});
					wx.previewImage({
						current: curImageSrc,
						urls: imgArray
					});
				}
			});
		});
		</script>
		{/if}
		</div>
	</div>
	{/if}
</div>


		{if $activity['isvoice']==1 || $activity['isrevoice']==1}
		<link rel="stylesheet" href="{MODULE_URL}template/weui/style/audio.css" />
        <script src="{MODULE_URL}template/weui/js/audio.js"></script>
        <script>
            $(function() {
                $('audio').audioPlayer();
            });
        </script>
		{/if}
		
<script type="text/javascript">
	function selectmenu(n){
		var eleMore = document.getElementById("menu_"+n);
		if(eleMore.style.display=="none"){
			eleMore.style.display = 'block';
			$("#cell_"+n+" svg").addClass("f-orange");
		}else{
			eleMore.style.display = 'none';
		}
	}
</script>
{/if}
{template 'footers'}